<template>
	<view class="">
		<u-button type="primary" text="确定"></u-button>
		<view class="box">
			<view class="box_son">
				测试scss12321321
				{{ 'Abac' | formatLetter }}
			</view>
		</view>
		<!-- uniapp 自带的button -->
		<button type="primary" @click="navto('/pages/pagesA/index/index')">pagsA</button>
		<button type="primary" @click="navto('/pages/pagesB/index/index')">pagsB</button>
		<u-radio-group v-model="update.invoice_type" @change="radioChange">
			<u-radio
				:customStyle="{marginRight: '16px'}"
				activeColor="#EE0A24"
				v-for="(item, index) in radioList"
				:key="index"
				:label="item.name"
				:name="item.value"
			>
			</u-radio>
		</u-radio-group>
	</view>
</template>

<script>
	class Update {
		constructor(data = {}) {
			this.id = data.id || ""
			this.invoice_type = data.invoice_type || 1 // 发票类型：1电子普通发票，2电子专用发票
			this.title_type = data.title_type || 1 // 抬头类型：1单位公司，2个人/非企业单位
			this.company = data.company || "" // 抬头名称
			this.tax_no = data.tax_no || "" // 公司税号
			this.address = data.address || "" // 公司地址
			this.mobile = data.mobile || "" // 电话
			this.bank = data.bank || "" // 开户银行
			this.account = data.account || "" // 银行账户
		}
	}
	
	export default {
		data() {
			return {
				update: new Update(),
				disabled: true,
				test: '',
				test1: '111',
				radioList: [{
						name: '电子普通发票',
						value: 1
					},
					{
						name: '电子专用发票',
						value: 2
					}
				],
			}
		},
		onLoad(e) {
			this.$http('fuck')
			this.update.invoice_type = 2
			// this.$http('DashboardNoAuthStaticData', {})
		},
		methods: {
			radioChange(name) {
				console.log(name);
				if (name == 2) {
					this.update.title_type = 0
				} else {
					this.update.title_type = 1
				}
				this.update.invoice_type = name
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		.box_son {
			color: red;
		}
	}
</style>